package cn.lingyangwl.agile.pay.client.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author shenguangyang
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("goods_order")
public class GoodsOrder {

    public static LambdaQueryWrapper<GoodsOrder> lqw() {
        return Wrappers.lambdaQuery();
    }

    public static LambdaUpdateWrapper<GoodsOrder> luw() {
        return Wrappers.lambdaUpdate();
    }

    @TableId
    private Long id;

    /**
     * 商品id
     */
    private Long goodsId;

    /**
     * 商品标题
     */
    private String goodsTitle;

    /**
     * 商品单价
     */
    private BigDecimal goodsAmount;

    /**
     * 购买数量
     */
    private Integer buyNum;

    /**
     * 订单唯一标识
     */
    private String mchOrderNo;

    /**
     * 1: 未支付订单, 2: 已经支付订单, 3超时取消订单
     */
    private String status;

    /**
     * 订单总金额
     */
    private BigDecimal totalAmount;

    /**
     * 订单实际支付价钱
     */
    private BigDecimal payAmount;

    /**
     * 支付方式代码
     */
    private String wayCode;

    /**
     * 账号昵称
     */
    private String nickname;

    /**
     * 用户id
     */
    private Long userId;

    /**
     * 0表示未删除, 1表示已经删除
     */
    private String del;

    /**
     * 发票类型, 1: 不开发票, 2: 电子发票, 3: 纸质发票
     */
    private String billType;

    /**
     * 发票头
     */
    private String billHeader;

    /**
     * 发票内容
     */
    private String billContent;

    /**
     * 发票收票人手机号
     */
    private String billReceiverPhone;

    /**
     * 发票收票人邮箱
     */
    private String billReceiverEmail;

    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;
}
